<?php
defined('IN_IA') or exit('Access Denied');
$session = json_decode(authcode($_GPC['__DM_food_session']), true);
if (is_array($session)) {
	$user = pdo_get("deamx_food_store_clerk",array('id'=>$session['uid'],'uniacid'=>$_W['uniacid']));
	if (is_array($user) && $session['hash'] == md5($user['password'].DM_PWDPRE)) {
		$_W['deam_food']['manage']['uid'] = $user['id'];
		$_W['deam_food']['manage']['username'] = $user['name'];
		$user['currentip'] = $user['lastip'];
		$user['lastip'] = $session['lastip'];
		$_W['deam_food']['manage']['user'] = $user;
	} else {
		isetcookie('__DM_food_session', false, -100);
	}
	unset($user);
}
unset($session);
?>